// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import Echarts from 'echarts'
import App from './App'
import router from './router'
import store from './store'
import * as $ajax from './requests'
import axios from 'axios'
Vue.prototype.$ajax=$ajax
Vue.prototype.$http = axios
Vue.prototype.echarts = Echarts


Vue.use(ElementUI);
Vue.use(Echarts);
Vue.config.productionTip = false


// 全局的导航守卫
router.beforeEach((to,from,next)=>{
  if(to.meta.isAuthRequired){
    next('/login')
  }else{
    next()
  }
})




/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
